from django.shortcuts import render
from .fhjieko import *
from django.http import HttpResponse
import json
# Create your views here.

def home(request):
    context = FhSearch().home()
    context_json = json.dumps(context)
    return HttpResponse(context_json)

def chapter(request,arg1, arg2):
    context = Fh().chapter(arg1, arg2)
    context_json = json.dumps(context)
    return HttpResponse(context_json)

def content(request,arg1, arg2, arg):
    context = Fh().content(arg1, arg2, arg)
    context_json = json.dumps(context)
    return HttpResponse(context_json)

def search(request,keyworld):
    context = FhSearch().search_book(keyworld)
    context_json = json.dumps(context)
    return HttpResponse(context_json)